package pers.cocoadel.cloud.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.cocoadel.cloud.user.dao.StudentRepository;
import pers.cocoadel.cloud.user.domain.Student;

import java.util.Optional;

@RequestMapping("/student")
@RestController
public class StudentController
{
    @Autowired
    private StudentRepository studentRepository;

    @GetMapping("/{id}")
    public Optional<Student> findById(@PathVariable Long id) {
        return this.studentRepository.findById(id);
    }
}
